package com.tuoyu.peopletest.view.pop;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.lxj.xpopup.core.CenterPopupView;
import com.tuoyu.peopletest.R;
import com.tuoyu.peopletest.scinterface.OnBtnListener;
import com.tuoyu.peopletest.scinterface.OnBtnListener03;
import com.tuoyu.peopletest.utils.SCUIUtils;

import androidx.annotation.NonNull;

/**
 * 结果通知弹窗
 */
public class ResultPop extends CenterPopupView {

    private Object hint;

    public ResultPop(@NonNull Context context, Object hint) {
        super(context);
        this.hint = hint;

    }

    @Override
    protected int getImplLayoutId() {

        return R.layout.pop_result;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        TextView tvBtnSure = findViewById(R.id.tv_btn_sure);
        TextView tvHint = findViewById(R.id.tv_hint);
        SCUIUtils.setTextStr(tvHint,hint);

        tvBtnSure.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                if (listener != null) {
                    listener.onLeft();
                }
                if (listener03 != null) {
                    listener03.onSure();
                }
            }
        });
    }
    private OnBtnListener listener;

    public void setBtnListener(OnBtnListener listener) {
        this.listener = listener;
    }

    private OnBtnListener03 listener03;

    public void setBtnListener(OnBtnListener03 listener) {
        this.listener03 = listener;
    }

}
